<@_categoryList advanced=true parentId=categoryId allowContribute=allowContribute pageIndex=pageNum count=numPerPage>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" method="post">
		<#include "../include_page/paramters.html"/>
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<select class="combox" name="allowContribute">
						<option value="">是否允许投稿</option>
						<option value="true"${(allowContribute?has_content&&"true"==allowContribute)?then(' selected="true"','')?no_esc}>允许投稿</option>
						<option value="false"${(allowContribute?has_content&&"false"==allowContribute)?then(' selected="true"','')?no_esc}>禁止投稿</option>
					</select>
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li>
						<button type="submit" class="buttonActive">搜索</button>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<@_sysAuthorized roleIds=admin.roles urls='cmsCategory/add,cmsCategory/delete,cmsCategory/publish,cmsCategory/static,cmsCategory/moveParameters,cmsCategory/publishParameters,cmsCategory/push_page'><#assign authorizedMap=map/></@_sysAuthorized>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
<#if authorizedMap['cmsCategory/add']>
			<li><a href="cmsCategory/add.html?parentId=${categoryId!}" target="navTab" rel="cmsCategory/add"><i class="icon-plus-sign-alt icon-large"></i> 添加分类</a></li>
	<@_categoryTypeList count=5>
		<#list page.list as a>
			<li><a href="cmsCategory/add.html?parentId=${categoryId!}&typeId=${a.id}" target="navTab" rel="cmsCategory/add"><i class="icon-plus-sign-alt icon-large"></i> 添加${(a.name)!}分类</a></li>
		</#list>
		<#if page.totalCount gt 5>
			<li><a href="cmsCategory/addMore.html?parentId=${categoryId!}" target="dialog" mask="true"><i class="icon-plus-sign icon-large"></i> 添加更多分类</a></li>
		</#if>
	</@_categoryTypeList>
			<li><a href="cmsCategory/add.html?id={sid}" target="navTab" rel="cmsCategory/edit" title="修改分类"><i class="icon-edit icon-large"></i> 修改分类</a></li>
			<li class="line">line</li>
</#if>
		<#if authorizedMap['cmsCategory/publish']>
			<li><a href="cmsCategory/publish.do" title="确定要生成该些记录吗?" target="selectedTodo" rel="ids"><i class="icon-file-text-alt icon-large"></i> 批量生成分类首页</a></li>
		</#if>
		<#if authorizedMap['cmsCategory/moveParameters']>
			<li><a href="cmsCategory/moveParameters.html" target="dialog" mask="true"><i class="icon-move icon-large"></i> 批量移动</a></li>
		</#if>
		<#if authorizedMap['cmsCategory/delete']>
			<li class="line">line</li>
			<li><a href="cmsCategory/delete.do" title="确定要删除该些记录吗?" target="selectedTodo" rel="ids"><i class="icon-trash icon-large"></i> 批量删除</a></li>
		</#if>
		</ul>
	</div>
	<table class="list" width="100%" layoutH="92">
		<thead>
			<tr>
				<th width="20"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="30">ID</th>
				<th>名称</th>
				<th>编码</th>
				<th>父分类</th>
				<th>内容数</th>
				<th>每页数据</th>
				<th>是否允许投稿</th>
				<th>是否前台隐藏</th>
				<th>排序</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<#list page.list as a>
				<@t.merge 'parentIds' a.parentId!/>
			</#list>
			<@_category ids=t.parentIds!><#assign parentMap=map!/></@_category>
			<#list page.list as a>
			<tr target="sid" rel="${a.id}">
				<td><input name="ids" value="${a.id}" type="checkbox"></td>
				<td>${a.id!}</td>
				<td><a href="${a.url!}" target="_blank">${(a.name)!}</a>${(a.onlyUrl?then("[外链]",''))!}</td>
				<td>${a.code!}</td>
				<td>${(parentMap[a.parentId?string].name)!}</td>
				<td>${a.contents!}</td>
				<td><#if !a.onlyUrl>${a.pageSize!}${(a.containChild?then("[包含子分类内容]",''))!}</#if></td>
				<td>${a.allowContribute?then('允许','禁止')}</td>
				<td>${a.hidden?then('隐藏','显示')}</td>
				<td>${a.sort!}</td>
				<td>
				<#if authorizedMap['cmsCategory/add']>
					<a href="cmsCategory/add.html?parentId=${a.id}" target="navTab" rel="cmsCategory/add">添加子分类</a>
					<a href="cmsCategory/add.html?copyId=${a.id}" target="navTab" rel="cmsCategory/add">复制分类</a>
				</#if>
				<#if authorizedMap['cmsCategory/push_page']>
					<a href="cmsCategory/push_page.html?categoryId=${a.id}&url=${(a.url?url)!}&title=${a.name!}" target="dialog" rel="push">推荐</a>
				</#if>
				<#if authorizedMap['cmsCategory/add']>
					<a href="cmsCategory/add.html?id=${a.id}" target="navTab" rel="cmsCategory/edit" title="修改分类">修改</a>
				</#if>
				<#if authorizedMap['cmsCategory/publishParameters']&&!a.onlyUrl>
					<a href="cmsCategory/publishParameters.html?id=${a.id}&pageSize=${a.pageSize}&containChild=${a.containChild?then('true','false')}" target="dialog" width="400" height="150" mask="true">生成</a>
				</#if>
				<#if authorizedMap['cmsCategory/delete']>
					<a href="cmsCategory/delete.do?ids=${a.id}" title="确定要删除这条记录么?" target="ajaxTodo">删除</a>
				</#if>
				</td>
			</tr>
			</#list>
		</tbody>
	</table>
	<#include "../include_page/page.html"/>
</div>
</@_categoryList>